package com.ayit.car.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 支付信息表
 * @TableName payment_info
 */
@TableName(value ="payment_info")
public class PaymentInfo implements Serializable {
    /**
     * 支付记录ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 关联的订单ID
     */
    private Long orderId;

    /**
     * 第三方支付平台交易号
     */
    private String transactionId;

    /**
     * 支付金额
     */
    private BigDecimal amount;

    /**
     * 支付时间
     */
    private Date paymentTime;

    /**
     * 支付状态，0-待支付, 1-支付中, 2-已支付, 3-支付失败, 4-已退款
     */
    private Integer paymentStatus;

    /**
     * 支付方式，1-微信支付, 2-支付宝, 3-信用卡, 4-借记卡, 5-其他
     */
    private Integer paymentMethod;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 支付记录ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 支付记录ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 关联的订单ID
     */
    public Long getOrderId() {
        return orderId;
    }

    /**
     * 关联的订单ID
     */
    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    /**
     * 第三方支付平台交易号
     */
    public String getTransactionId() {
        return transactionId;
    }

    /**
     * 第三方支付平台交易号
     */
    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    /**
     * 支付金额
     */
    public BigDecimal getAmount() {
        return amount;
    }

    /**
     * 支付金额
     */
    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    /**
     * 支付时间
     */
    public Date getPaymentTime() {
        return paymentTime;
    }

    /**
     * 支付时间
     */
    public void setPaymentTime(Date paymentTime) {
        this.paymentTime = paymentTime;
    }

    /**
     * 支付状态，0-待支付, 1-支付中, 2-已支付, 3-支付失败, 4-已退款
     */
    public Integer getPaymentStatus() {
        return paymentStatus;
    }

    /**
     * 支付状态，0-待支付, 1-支付中, 2-已支付, 3-支付失败, 4-已退款
     */
    public void setPaymentStatus(Integer paymentStatus) {
        this.paymentStatus = paymentStatus;
    }

    /**
     * 支付方式，1-微信支付, 2-支付宝, 3-信用卡, 4-借记卡, 5-其他
     */
    public Integer getPaymentMethod() {
        return paymentMethod;
    }

    /**
     * 支付方式，1-微信支付, 2-支付宝, 3-信用卡, 4-借记卡, 5-其他
     */
    public void setPaymentMethod(Integer paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PaymentInfo other = (PaymentInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getTransactionId() == null ? other.getTransactionId() == null : this.getTransactionId().equals(other.getTransactionId()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getPaymentTime() == null ? other.getPaymentTime() == null : this.getPaymentTime().equals(other.getPaymentTime()))
            && (this.getPaymentStatus() == null ? other.getPaymentStatus() == null : this.getPaymentStatus().equals(other.getPaymentStatus()))
            && (this.getPaymentMethod() == null ? other.getPaymentMethod() == null : this.getPaymentMethod().equals(other.getPaymentMethod()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getTransactionId() == null) ? 0 : getTransactionId().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getPaymentTime() == null) ? 0 : getPaymentTime().hashCode());
        result = prime * result + ((getPaymentStatus() == null) ? 0 : getPaymentStatus().hashCode());
        result = prime * result + ((getPaymentMethod() == null) ? 0 : getPaymentMethod().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderId=").append(orderId);
        sb.append(", transactionId=").append(transactionId);
        sb.append(", amount=").append(amount);
        sb.append(", paymentTime=").append(paymentTime);
        sb.append(", paymentStatus=").append(paymentStatus);
        sb.append(", paymentMethod=").append(paymentMethod);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}